package com.example.springboot.controller;

import com.example.springboot.bean.Province;
import com.example.springboot.service.ProvinceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by tang on 2018/3/11.
 */
@RestController
@RequestMapping("/province")
public class ProvinceController {

    @Autowired
    ProvinceService provinceService;

    @RequestMapping("/findByName")
    public String findByName(String name) {
        Province province = provinceService.findByName(name);
        System.out.println(province.getCityList());
        return province.toString();
    }
}
